home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / self / contrib.lha / contrib / README-xlib-support < prev    next >
Text File  |  1993-07-24  |  4KB  |  135 lines

  1. Improved Xlib support for release 2.0.1
  2. ---------------------------------------
  3.  
  4. This package provides improved Xlib support for Self release 2.0.1.
  5. The Xlib primitives are now dynamically linked (release 2.0.1 has
  6. statically linked Xlib primitives).  Many primitives have been added;
  7. in particular, drawing primitives are now present.  In addition, it
  8. should be simpler to add new Xlib primitives by following the examples
  9. present in xlibTemplates.self and using xlib_glue.make (see the manual
  10. for details about glue).
  11.  
  12. This package is compatible with release 2.0.1, including the ui.
  13. The interface to some of the Xlib objects may have changed slightly.
  14.  
  15. sun3 is not supported.
  16.  
  17.  
  18. Files in this package
  19. ---------------------
  20.  
  21.   README-xlib-support
  22.     This file.
  23.  
  24.   primitiveMaker.self
  25.   (version 8.2)
  26.     This is the same as the file in the patches directory.
  27.  
  28.   xlib.primMaker.h
  29.     Generated by the primitive maker, from xlibTemplates.self.
  30.  
  31.   xlib.self
  32.   (version 8.2.1)
  33.     Along with xlib_wrappers.self, this is the interface to the Xlib
  34.     primitives.  (Some of the primitives are further wrapped in
  35.     xlib.self; some are used directly as they exist in xlib_wrappers.self.)
  36.  
  37.   xlib.wrappers.self
  38.     Generated by the primitive maker, from xlibTemplates.self.
  39.  
  40.   xlibPrims.h
  41.   (version 8.0, the same as in release 2.0.1)
  42.     Header file needed by xlib_glue.c.
  43.  
  44.   xlibTemplates.self
  45.   (version 8.1)
  46.     Templates used by the primitive maker to create the glue on the
  47.     C side (xlib.primMaker.h) and on the Self side (xlib_wrappers.self).
  48.     This is the place to add new Xlib primitives.  To generate the
  49.     glue files, do "'xlibTemplates.self' _RunScript" at the Self prompt.
  50.  
  51.   xlib_glue.c
  52.   (version 8.1)
  53.     These functions are wrappers for Xlib calls that cannot be directly
  54.     glued in.  The functions typically do some extra manipulation of
  55.     incoming arguments before passing them on to the actual Xlib call,
  56.     and may manipulate the result before returning.  Most Xlib calls
  57.     do not have to have a separate wrapper in xlib_glue.c, but instead
  58.     can be specified directly in xlibTemplates.self.
  59.  
  60.   xlib_glue.make
  61.   (version 8.1)
  62.     This makefile creates xlib_glue.so, the dynamic library.
  63.  
  64.   xlib_glue.so
  65.     Shared library for sun4.
  66.  
  67.  
  68. Installation
  69. ------------
  70.  
  71. 1. In your Self source directory, place:
  72.  
  73.       primitiveMaker.self     (replace the old primitiveMaker.self)
  74.       xlib.primMaker.h
  75.       xlib.self                     (replace the old xlib.self)
  76.       xlib.wrappers.self
  77.       xlibTemplates.self
  78.       xlib_glue.c
  79.       xlib_glue.make
  80.       xlib_glue.so
  81.  
  82. 2. If you installed the optional glue package, place xlibPrims.h in
  83.    your glueDefs directory.
  84.  
  85.  
  86. Use
  87. ---
  88.  
  89. Browse through xlibTemplates.self to see what primitives are
  90. supported.  All primitives have Self wrappers defined in
  91. xlib.wrappers.self; most of them are given a nicer interface in
  92. xlib.self.
  93.  
  94. The file "window.self," which can be found in the ftp contrib directory,
  95. contains a sample window object that you can modify for your own uses.
  96.  
  97.  
  98. Adding additional Xlib primitives
  99. ---------------------------------
  100.  
  101. To add new primitives, you must have installed the optional glue package.
  102.  
  103. 1. Add templates to xlibTemplates.self.  See the existing templates for
  104.    examples; a minimal amount of documentation is available in
  105.    primitiveMaker.self.
  106.  
  107. 2. In some cases, you may have to create a wrapper function for your
  108.    primitive, in order to munge the arguments to or result from the
  109.    primitive.  Put these wrappers in xlib_glue.c.
  110.  
  111. 3. If you need to introduce a new type seal, add it to the list at
  112.    the top of xlib_glue.c.
  113.  
  114. 4. Run the primitive maker by doing:  'xlibTemplates' _RunScript
  115.    (The file xlibTemplates.self is actually a single expression,
  116.    which runs the primitive maker on a very long string, the templates).
  117.  
  118.    This should create the two files, xlib.wrappers.self and
  119.    xlib.primMaker.h, in your Self source directory.  xlib.wrappers.self
  120.    contains the Self side wrappers for the primitives, and
  121.    xlib.primMaker.h contains the glue for the C side.
  122.  
  123. 5. Create the shared library by doing:  make -f xlib_glue.make
  124.    There may be warnings, which you can probably ignore.
  125.  
  126. 6. If desired, create another layer on top of the Self wrappers, which
  127.    will be the usual interface to the primitives.  This interface
  128.    goes in xlib.self.
  129.  
  130. 7. When you run Self, the new xlib_glue.so will be loaded when necessary.
  131.  
  132.  
  133.  
  134. Report bugs in this package to self-bugs@self.stanford.edu.
  135.